package com.fun_ordering.mapper;

import com.fun_ordering.pojo.DishType;
import com.fun_ordering.pojo.DishTypeExample;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
@Mapper
public interface DishTypeMapper {
    int countByExample(DishTypeExample example);

    int deleteByExample(DishTypeExample example);

    int deleteByPrimaryKey(Integer typeId);

    int insert(DishType record);

    int insertSelective(DishType record);

    List<DishType> selectByExample(DishTypeExample example);

    /**
     * 菜品类型菜品信息联合查询所有类型和菜品信息
     * 对于菜品信息根据菜品类型进行分类，并按照类型的优先级别(使用state字段)进行分类展示
     * @return
     */
    List<DishType> selectDishListByType();

    DishType selectByPrimaryKey(Integer typeId);

    int updateByExampleSelective(@Param("record") DishType record, @Param("example") DishTypeExample example);

    int updateByExample(@Param("record") DishType record, @Param("example") DishTypeExample example);

    int updateByPrimaryKeySelective(DishType record);

    int updateByPrimaryKey(DishType record);
}